<?php

$_this =& $this;

/* @var $_this View */
/* @var $form FormHelper */
/* @var $editForm EditFormHelper */
/* @var $html HtmlHelper */
/* @var $ehtml EHtmlHelper */
/* @var $javascript JavascriptHelper */
/* @var $jqax JqaxHelper */
/* @var $filterBlock FilterBlock */

?><h3 class="t_nm"><?=__d($po_domain, 'list_title', true);?></h3><?php

if (count($tests_list)) {

?><table class="table" cellpadding="0"><?php
?><thead><?php
    ?><tr><?php
        ?><th class="nw"><?php
            ?><?=__d($po_domain, 'name', true);?><?php
        ?></th><?php
        ?><th class="nw"><?php
            ?><?=__d($po_domain, 'type', true);?><?php
        ?></th><?php
        ?><th class="nw align-c" colspan="3"><?php
            ?><?=__d($po_domain, 'price', true);?><?php
        ?></th><?php
    ?></tr><?php
?></thead><?php
?><tbody><?php

    $i = 0;
    foreach ($tests_list as $item) {
        $class = '';
    	if ($i++ % 2 != 0) {
    		$sep = strlen($class) ? ' ' : '';
    		$class .= $sep.'altrow';
    	}
    	$class = strlen($class) ? ' class="'.$class.'"' : '';

        ?><tr <?=$class;?>><?php
    		?><td class="nw" rowspan="2"><?php
                ?><?=$item[$modelName]['name'];?><?php
            ?></td><?php
    		?><td class="nw" rowspan="2"><?php
                ?><?=__d($po_domain, 'type_'.$item[$modelName]['type']);?><?php
            ?></td><?php
    		?><td class="nw"><?php
                ?><?=__d($po_domain, 'for_test', true);?><?php
            ?></td><?php
    		?><td class="nw align-r"><?php
				?><?=$this->renderElement('amount', array('amount' => $item[$modelName]['price_test'], 'currency' => 'EP'));?><?php
            ?></td><?php
    		?><td class="nw"><?php
                ?><table class="sys_clear" cellpadding="0"><?php
                ?><tr class="sys_clear"><?php
    				?><?=$ehtml->iconLink("edit", __d($po_domain, 'change_price', true), array("controller" => "tests", "action" => "change_prices", "id" => $item[$modelName]['id'], "price_type" => "TEST"));?><?php
                ?></tr><?php
                ?></table><?php
            ?></td><?php
        ?></tr><?php
        ?><tr <?=$class;?>><?php
    		?><td class="nw"><?php
                ?><?=__d($po_domain, 'for_blank', true);?><?php
            ?></td><?php
    		?><td class="nw align-r"><?php
                ?><?=$this->renderElement('amount', array('amount' => $item[$modelName]['price_blank'], 'currency' => 'EP'));?><?php
            ?></td><?php
    		?><td class="nw"><?php
                ?><table class="sys_clear" cellpadding="0"><?php
                ?><tr class="sys_clear"><?php
	       			?><?=$ehtml->iconLink("edit", __d($po_domain, 'change_price', true), array("controller" => "tests", "action" => "change_prices", "id" => $item[$modelName]['id'], "price_type" => "BLANK"));?><?php
                ?></tr><?php
                ?></table><?php
            ?></td><?php
    	?></tr><?php
    }

?></tbody><?php
?></table><?php

} else {
    ?><span class="additional_msg"><?php
        ?><?=__d($po_domain, 'List is empty', true);?><?php
    ?></span><?php
}

?><h3><?=__d('reports', 'list_title', true);?></h3><?php

if (count($reports_list)) {

?><table class="table" cellpadding="0"><?php
?><thead><?php
    ?><tr><?php
        ?><th class="nw"><?php
            ?><?=__d('reports', 'name', true);?><?php
        ?></th><?php
        ?><th class="nw"><?php
            ?><?=__d('tests', 'type', true);?><?php
        ?></th><?php
        ?><th class="nw align-c" colspan="3"><?php
            ?><?=__d('tests', 'price', true);?><?php
        ?></th><?php
    ?></tr><?php
?></thead><?php
?><tbody><?php

    $i = 0;
    foreach ($reports_list as $item) {
        $class = '';
    	if ($i++ % 2 != 0) {
    		$sep = strlen($class) ? ' ' : '';
    		$class .= $sep.'altrow';
    	}
    	$class = strlen($class) ? ' class="'.$class.'"' : '';
    	$rowspan = ($item['Report']['type'] == 'CONSOLIDATED') ? ' rowspan="2"' : '';
        ?><tr <?=$class;?>><?php
    		?><td class="nw"<?=$rowspan;?>><?php
                ?><?=$item['Report']['name'];?><?php
            ?></td><?php
    		?><td class="nw"<?=$rowspan;?>><?php
                ?><?=__d('reports', 'type_'.$item['Report']['type']);?><?php
            ?></td><?php
    		?><td class="nw"><?php
				?><?=__d('reports', 'price_report2', true);?><?php
            ?></td><?php
    		?><td class="nw align-r"><?php
				?><?=$this->renderElement('amount', array('amount' => $item['Report']['price'], 'currency' => 'EP'));?><?php
            ?></td><?php
    		?><td class="nw"><?php
                ?><table class="sys_clear" cellpadding="0"><?php
                ?><tr class="sys_clear"><?php
    				?><?=$ehtml->iconLink("edit", __d($po_domain, 'change_price', true), array("controller" => "reports", "action" => "change_prices", "id" => $item['Report']['id'], "price_type" => "REPORT"));?><?php
                ?></tr><?php
                ?></table><?php
            ?></td><?php
        ?></tr><?php
        if ($item['Report']['type'] == 'CONSOLIDATED') {
            ?><tr <?=$class;?>><?php
        		?><td class="nw"><?php
    				?><?=__d('reports', 'price_candidate2', true);?><?php
                ?></td><?php
        		?><td class="nw align-r"><?php
    				?><?=$this->renderElement('amount', array('amount' => $item['Report']['add_price'], 'currency' => 'EP'));?><?php
                ?></td><?php
        		?><td class="nw"><?php
                    ?><table class="sys_clear" cellpadding="0"><?php
                    ?><tr class="sys_clear"><?php
        				?><?=$ehtml->iconLink("edit", __d($po_domain, 'change_price', true), array("controller" => "reports", "action" => "change_prices", "id" => $item['Report']['id'], "price_type" => "CANDIDATE"));?><?php
                    ?></tr><?php
                    ?></table><?php
                ?></td><?php
            ?></tr><?php
        }
    }

?></tbody><?php
?></table><?php

} else {
    ?><span class="additional_msg"><?php
        ?><?=__d('reports', 'List is empty', true);?><?php
    ?></span><?php
}

?>